# 数据模型定义
from django.db import models


class UserProfile(models.Model):
    """用户资料模型，存储用户的基本信息"""
    username = models.CharField(max_length=50, unique=True, verbose_name="用户名")
    gender = models.CharField(max_length=10, verbose_name="性别")  # 男/女/其他
    age = models.IntegerField(verbose_name="年龄")
    hobby = models.CharField(max_length=200, verbose_name="爱好")  # 用逗号分隔多个爱好
    height = models.FloatField(verbose_name="身高(cm)")
    weight = models.FloatField(verbose_name="体重(kg)")
    behavior_habit = models.TextField(verbose_name="行为习惯")  # 日常习惯、活动等
    created_at = models.DateTimeField(auto_now_add=True, verbose_name="创建时间")
    updated_at = models.DateTimeField(auto_now=True, verbose_name="更新时间")

    def __str__(self):
        return self.username

    class Meta:
        verbose_name = "用户资料"
        verbose_name_plural = "用户资料"
